import Vue from 'vue'
import VueRouter from 'vue-router'


Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect:{
      name:'index'
    }
  },
  {
    path: '/index',
    name: 'index',
    component: () => import(/* webpackChunkName: "about" */ './views/Home/Index.vue')
  },
  {
    // 归档页
    path: '/archives',
    name: 'archives',
    component: () => import('./views/Archives/Index.vue')
  },
  {
    // 分类页
    path: '/categories',
    name: 'categories',
    component: () => import('./views/Categories/Index.vue')
  },
  {
    // 分类页 详情页
    path: '/categories/details',
    name: 'categoriesDetails',
    component: () => import('./views/Categories/Details.vue')
  },
  {
    // 标签页 
    path: '/tags',
    name: 'tags',
    component: () => import('./views/Tags/Index.vue')
  },
  {
    // 标签页 详情页
    path: '/tags/details',
    name: 'tagsDetails',
    component: () => import('./views/Tags/Details.vue')
  },
  {
    // 关于页面
    path: '/about',
    name: 'about',
    component: () => import('./views/About/Index.vue')
  },
  {
    // 文章页面
    path: '/articles',
    name: 'articles',
    component: () => import('./views/Articles/Index.vue')
  },
  {
    // 文章的详情页
    path: '/articles/details',
    name: 'articlesDetails',
    component: () => import('./views/Articles/Details.vue')
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
